const template=/*html*/`
	<i-form ref="fromQuery"  inline :label-width="70">
	  <#assign row_cols =3> <#--定义每行多少个元素 -->
      <#list list as item>
      <#if  (item_index>0 &&  item_index%row_cols ==0)  >
	    </Row><!--end row  ${item_index/row_cols -1}-->
      </#if>
	  <#if item_index%row_cols ==0 >
        <!--start row ${item_index/row_cols}-->
	    <Row>	
	  </#if>
	     <i-col span="8">
	     <form-item label="<#if item.comments?length  lte 10>${item.comments}<#else>${item.comments[0..10]}</#if>" >
            <#if item.javaType?contains("Date")>
              <date-picker type="date" clearable placeholder="<#if item.comments?length  lte 10>${item.comments}<#else>${item.comments[0..10]}</#if>" v-model="qvo.${item.beanLable}EQ_" style="width:218px"></date-picker>
            <#elseif item.javaType?contains("String")>
              <i-input type="text"      clearable placeholder="<#if item.comments?length  lte 10>${item.comments}<#else>${item.comments[0..10]}</#if>" v-model="qvo.${item.beanLable}EQ_" style="width:218px"></i-input>
            <#else >
              <i-input type="number"    clearable placeholder="<#if item.comments?length  lte 10>${item.comments}<#else>${item.comments[0..10]}</#if>" v-model="qvo.${item.beanLable}EQ_" style="width:218px"></i-input>  
            </#if>
	     </form-item></i-col>
	   <#if  !item_has_next >
	     <form-item>        
		  <button type="button" class="btn btn-outline-primary btn-sm" @click="listSubmit"><Icon type="ios-search" ></Icon>查询</button>
	     </form-item>
		</Row><!--end row ${item_index/row_cols}-->
       </#if>
	  </#list> 
	</i-form>	
<table class="table table-sm  table-hover table-bordered">
  <thead>
    <tr>
      <th style="width: 35px;" >#</th>
      <#list list as item>
      <th scope="col"><#if item.comments?length lte 10>${item.comments}<#else>${item.comments[0..10]}</#if></th>
      </#list>
      <th style="width: 200px;">操作 &nbsp;&nbsp;&nbsp;&nbsp;
		<a href="javascript:void(0)" class="link-success" @click="routerTo('add')" ><svg  width="16" height="16" fill="currentColor" ><use xlink:href="#icon_add"/></svg>添加</a>
      </th>
    </tr>
  </thead>
  <tbody class="table-group-divider">
   <template  v-for="(o,i)  in list" :key="i">
        <tr >
            <td scope="row">{{i+1}}</td>
            <#list list as item>
              <td >{{o.${item.beanLable}}}</td>
            </#list> 
            <td>
			  <a href="javascript:void(0)" class="link-warning" @click="deleteByIds(o)" ><svg  width="16" height="16" fill="currentColor" ><use xlink:href="#icon_delete"/></svg>删除</a> 
              &nbsp;&nbsp;
			  <a href="javascript:void(0)" class="link-primary" @click="routerTo('edit',{id: o.id})" ><svg  width="16" height="16" fill="currentColor"  ><use xlink:href="#icon_edit"/></svg>编辑</a>
              &nbsp;&nbsp;
              <a href="javascript:void(0)" class="link-info" @click="routerTo('view',{id: o.id})" ><svg  width="16" height="16" fill="currentColor"  ><use xlink:href="#icon_view"/></svg>查看</a>
            </td>
        </tr>
    </template>
  </tbody>
</table>
<Page class="float-end" :total="page.total" :page-size="page.pageSize"  :show-total="true"  @on-change="onChangePage"/>
`

import {ref} from 'vue'
import {useList} from 'base'
export default {
  template,
  setup() {
	const qvo = ref({
		<#list list as item>
	    ${item.beanLable}EQ_:null,
		</#list>	
	})
		
	const listSetup=useList({basePath:'${modPath}<#if modPath?? && modPath !='' && !modPath?ends_with("/") >/</#if>${className?lower_case}',qvo})
	return { ...listSetup }
  }
}
